function factorial(n) {   
   return n < 2 ? 1 : factorial(n - 1) * n;
}

function test(expected, actual) {
   print('actual ==> ' + actual);
   assertEquals(expected, actual);
}

test(120, factorial(5));
test(720, factorial(6));
test(3628800, factorial(10));
test(39916800, factorial(11));